﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Al.UI.Controls
{
    public class CometController
    {
        private object _someData;

        public object SomeData
        {
            get { return _someData; }
            set { _someData = value; }
        }
        private bool _isDirty = false;

        public bool IsDirty
        {
            get { return _isDirty; }
            set { _isDirty = value; }
        }
        private string _sessionID;

        public string SessionID
        {
            get { return _sessionID; }
            set { _sessionID = value; }
        }

        public CometController(string sessionID)
        {
            this._sessionID = sessionID;
            RandomDataProvider.DataChanged += new DataChangedEventHandler(RandomDataProvider_DataChangedEvent);
        }

        private void RandomDataProvider_DataChangedEvent(DataChangedEventArgs e)
        {
            this._someData = e;
            CometServer.NotifyMessageRecieved(this, e);
        }

        internal void Invalidate()
        {
            throw new NotImplementedException();
        }
    }
}
